using System;
namespace AppToolKit.Business.Plugin
{
	public class ImplementAttrHelper
	{
		public static ImplementAttrParams GetCode<T>()
		{
			Type typeFromHandle = typeof(T);
			if (!typeFromHandle.IsDefined(typeof(ImplementAttribute), false))
			{
				throw new Exception("no define CardTypeAttribute");
			}
			ImplementAttribute implementAttribute = typeFromHandle.GetCustomAttributes(typeof(ImplementAttribute), true)[0] as ImplementAttribute;
			return new ImplementAttrParams
			{
				Value = implementAttribute.Code,
				Descript = implementAttribute.Descript,
				Default = implementAttribute.Default
			};
		}
	}
}
